﻿<%@ Page Title="Fare Segments" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="FareSegments.aspx.cs" Inherits="IFD2.FareSegments" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label21" runat="server" Text="Airline:" meta:resourcekey="Airline"></asp:Label>
                <asp:Label ID="lblAirline" runat="server" Font-Bold="true"></asp:Label><br />
                <asp:Label ID="Label11" runat="server" Text="Fare Code:" meta:resourcekey="FareCode"></asp:Label>
                <asp:Label ID="lblFareCode" runat="server" Font-Bold="true"></asp:Label><br />
                <asp:Label ID="Label10" runat="server" Text="Op Airline:" meta:resourcekey="OpAirline"></asp:Label>
                <asp:Label ID="lblOpAirline" runat="server" Font-Bold="true"></asp:Label><br />
                <asp:Label ID="Label19" runat="server" Text="Cabin:" meta:resourcekey="Cabin"></asp:Label>
                <asp:Label ID="lblCabin" runat="server" Font-Bold="true"></asp:Label>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" style="min-width:600px;width:100%;" class="table-hover"
                            DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" DataKeyNames="airline,fare_code,seg_sn">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                    <input name="KEY" type="radio" value='<%# Eval("seg_sn") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="seg_sn" HeaderText="seg_sn" ReadOnly="True" SortExpression="seg_sn"  meta:resourcekey="seg_sn" />
                                <asp:BoundField DataField="ori_airport" HeaderText="ori_airport" SortExpression="ori_airport"  meta:resourcekey="ori_airport" />
                                <asp:BoundField DataField="des_airport" HeaderText="des_airport" SortExpression="des_airport"  meta:resourcekey="des_airport" />
                                <asp:BoundField DataField="ori_city" HeaderText="ori_city" SortExpression="ori_city"  meta:resourcekey="ori_city" />
                                <asp:BoundField DataField="des_city" HeaderText="des_city" SortExpression="des_city"  meta:resourcekey="des_city" />
                                <asp:BoundField DataField="week_mask" HeaderText="week_mask" SortExpression="week_mask"  meta:resourcekey="week_mask" />
                                <asp:BoundField DataField="stay_min" HeaderText="stay_min" SortExpression="stay_min"  meta:resourcekey="stay_min" />
                                <asp:BoundField DataField="stay_max" HeaderText="stay_max" SortExpression="stay_max"  meta:resourcekey="stay_max" />
                                <asp:BoundField DataField="class" HeaderText="class" SortExpression="class"  meta:resourcekey="class1" />
                                <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user"  meta:resourcekey="done_user" />
                                <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time"  meta:resourcekey="done_time" />
                            </Columns>
                            <RowStyle BackColor="#EFF3FB" />
                            <EditRowStyle BackColor="#2461BF" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>

                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                            SelectCommand="bll_fare_get_segments" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                <asp:ControlParameter ControlID="lblFareCode" Name="fare_code" PropertyName="Text" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>

                    <div class="btn-group">
                        <asp:Button ID="btnPriceStairs" runat="server" Text="Price Stairs..." OnClick="btnPriceStairs_Click" meta:resourcekey="PriceStairs" CssClass="btn btn-sm btn-default" />
                        <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click"  meta:resourcekey="Delete" CssClass="btn btn-sm btn-default" />
                    </div><br />
                    <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>

                    <asp:Panel ID="panAdd" runat="server">
                    <div class="well well-sm">
                        <div class="form-group">
                        <asp:Label ID="Label1" runat="server" Text="Segment No.:" meta:resourcekey="SegmentNo"></asp:Label>
                        <asp:DropDownList ID="lstSegNo" runat="server">
                            <asp:ListItem Selected="True" Value="1"></asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label2" runat="server" Text="Origin:" meta:resourcekey="Origin"></asp:Label>
                        <asp:TextBox ID="txtOriAirport" runat="server" MaxLength="4" Width="50px"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label3" runat="server" Text="Destination:" meta:resourcekey="Destination"></asp:Label>
                        <asp:TextBox ID="txtDesAirport" runat="server" MaxLength="4" Width="50px"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label4" runat="server" Text="Class:" meta:resourcekey="Class"></asp:Label>&nbsp;
                        <asp:DropDownList ID="lstClass" runat="server" DataSourceID="sqlClasses" DataTextField="class" DataValueField="class"></asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label5" runat="server" Text="Stay Min(days):" meta:resourcekey="StayMindays"></asp:Label>
                        <asp:DropDownList ID="lstStayMin" runat="server">
                            <asp:ListItem Selected="True">0</asp:ListItem>
                            <asp:ListItem>1</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem>5</asp:ListItem>
                            <asp:ListItem>6</asp:ListItem>
                            <asp:ListItem>7</asp:ListItem>
                            <asp:ListItem>8</asp:ListItem>
                            <asp:ListItem>9</asp:ListItem>
                            <asp:ListItem>10</asp:ListItem>
                            <asp:ListItem>11</asp:ListItem>
                            <asp:ListItem>12</asp:ListItem>
                            <asp:ListItem>13</asp:ListItem>
                            <asp:ListItem>14</asp:ListItem>
                            <asp:ListItem>15</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label6" runat="server" Text="Stay Max:" meta:resourcekey="StayMax"></asp:Label>
                        <asp:TextBox ID="txtStayMax" runat="server" Width="52px">100</asp:TextBox>
                        </div><br class="hidden-xs" />
                        <div class="form-group">
                        <asp:Label ID="Label20" runat="server" Text="Week:" meta:resourcekey="Week"></asp:Label>
                        &nbsp;&nbsp;<asp:CheckBox ID="chkWeek1" runat="server" Text="Monday" Checked="True" meta:resourcekey="Monday"/>&nbsp;
                        <asp:CheckBox ID="chkWeek2" runat="server" Text="Tuesday" Checked="True" meta:resourcekey="Tuesday"/>&nbsp;
                        <asp:CheckBox ID="chkWeek3" runat="server" Text="Wednesday" Checked="True" meta:resourcekey="Wednesday"/>&nbsp;
                        <asp:CheckBox ID="chkWeek4" runat="server" Text="Thursday" Checked="True" meta:resourcekey="Thursday"/>&nbsp;
                        <asp:CheckBox ID="chkWeek5" runat="server" Text="Friday" Checked="True" meta:resourcekey="Friday"/>&nbsp;
                        <asp:CheckBox ID="chkWeek6" runat="server" Text="Saturday" Checked="True" Font-Bold="True" meta:resourcekey="Saturday"/>&nbsp;
                        <asp:CheckBox ID="chkWeek7" runat="server" Text="Sunday" Checked="True" Font-Bold="True" meta:resourcekey="Sunday" ForeColor="Red" />
                        </div><br class="hidden-xs" />
                        <asp:Button ID="btnAdd" runat="server" Text=" Add " OnClick="btnAdd_Click" meta:resourcekey="Add" CssClass="btn btn-sm btn-default" />
                        <br />
                        <asp:Label ID="Label24" runat="server" Text="Note: Open票部分限制无效！" meta:resourcekey="Note" Font-Italic="true"></asp:Label>

                        <asp:SqlDataSource ID="sqlClasses" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                            SelectCommand="bll_airline_get_class_codes_by_cabin" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lblOpAirline" Name="airline" PropertyName="Text" Type="String" />
                                <asp:ControlParameter ControlID="lblCabin" Name="cabin" PropertyName="Text" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>
                    </asp:Panel>

                </div>
            </div>
        </div>
    </div>

    </div>
    </ContentTemplate></asp:UpdatePanel>
    </form>

</asp:Content>
